using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VGPDAT
    {
        public void SetUpNewRow(ref DataRow dwReturn, DataRow dwInput)
        {

            switch (app.company)
            {
                case "YGR":
                case "TST":
                case "SXN":
                case "UBT":
                default:
                    #region=========
                    dwReturn["GPMANDANT"] = app.Mandant;
                    dwReturn["GPPARTIE"] = "0000000";
                    dwReturn["GPPARTIEKZ"] = "0";
                    dwReturn["GPGART"] = "                    ";
                    dwReturn["GPGVAR"] = "   ";
                    dwReturn["GPGFARBE"] = "000000    ";
                    dwReturn["GPBESTTYP"] = " ";
                    dwReturn["GPBESTKRS"] = "  ";
                    dwReturn["GPBESTLFD"] = "000000";
                    dwReturn["GPBESTPOS"] = "000";
                    dwReturn["GPPOSA"] = "0000";
                    dwReturn["GPLIEFNR"] = "        ";
                    dwReturn["GPKUNDNR"] = "        ";
                    dwReturn["GPEINDAT"] = "0";
                    dwReturn["GPSPULBST"] = " ";
                    dwReturn["GPSPSTA"] = "  ";
                    dwReturn["GPSPGRD"] = "00";
                    dwReturn["GPFDRES"] = "N";
                    dwReturn["GPKF"] = " ";
                    dwReturn["GPZENSUR1"] = "1";
                    dwReturn["GPZENDAT1"] = "0";
                    dwReturn["GPZENSUR2"] = " ";
                    dwReturn["GPZENDAT2"] = "0";
                    dwReturn["GPZENSUR3"] = " ";
                    dwReturn["GPZENDAT3"] = "0";
                    dwReturn["GPGEM"] = " ";
                    dwReturn["GPLAENGE"] = "0";
                    dwReturn["GPWICKL"] = " ";
                    dwReturn["GPAUFMSL"] = "SM";
                    dwReturn["GPLIEFSCH"] = ".       ";
                    dwReturn["GPREDAT"] = "0";
                    dwReturn["GPBUCHDAT"] = "0";
                    dwReturn["GPRENR"] = "INVENTUR  ";
                    dwReturn["GPREWERT"] = "1";
                    dwReturn["GPSPPART"] = "          ";
                    dwReturn["GPFBPART"] = "          ";
                    dwReturn["GPZWPART"] = "          ";
                    dwReturn["GPIFEUCHTE"] = "850";
                    dwReturn["GPEINBRUT"] = "0";
                    dwReturn["GPEINNET"] = "0";
                    dwReturn["GPEINHAN"] = "0";
                    dwReturn["GPEINKART"] = "1";
                    dwReturn["GPEINSPUL"] = "0";
                    dwReturn["GPVERPACK"] = "0";
                    dwReturn["GPHUELSEN"] = "0";
                    dwReturn["GPBEM1"] = "                                        ";
                    dwReturn["GPBEM2"] = "                                        ";
                    dwReturn["GPFTEXT"] = "    ";
                    dwReturn["GPPRODLO"] = "  ";
                    dwReturn["GPPRODLB"] = "  ";
                    dwReturn["GPPRODLP"] = "        ";
                    dwReturn["GPKOKRS"] = "  ";
                    dwReturn["GPKOLFD"] = "000000";
                    dwReturn["GPKOPOS"] = "000";
                    dwReturn["GPKAKZ"] = "J";
                    dwReturn["GPENTKZ"] = "I";
                    dwReturn["GPJJJJ"] = "0";
                    dwReturn["GPBELEG"] = "0";
                    dwReturn["GPEINLO"] = "01";
                    dwReturn["GPEINZS"] = "1";
                    dwReturn["GPTEXTSL1"] = "   ";
                    dwReturn["GPTEXTSL2"] = "   ";
                    dwReturn["GPHUELTYP"] = "      ";
                    dwReturn["GPKZZOLL"] = "N";
                    dwReturn["GPSPDURCHM"] = "0";
                    dwReturn["GPSPHOEHE"] = "0";
                    dwReturn["GPESF"] = "0";
                    dwReturn["GPDSPULGEW"] = "0";
                    dwReturn["GPPSTART"] = "    ";
                    dwReturn["GPKDPARTIE"] = "          ";
                    dwReturn["GPGFEUCHTE"] = "0";
                    dwReturn["GPTITER"] = "0";
                    dwReturn["GPMUKZ"] = " ";
                    dwReturn["GPFA"] = "000";
                    dwReturn["GPSHADE"] = "   ";
                    dwReturn["GPHHK1"] = "0";
                    dwReturn["GPHHK2"] = "0";
                    dwReturn["GPHHK3"] = "0";
                    dwReturn["GPHHK4"] = "0";
                    dwReturn["GPHHK5"] = "0";
                    dwReturn["GPHHK6"] = "0";
                    dwReturn["GPHHK7"] = "0";
                    dwReturn["GPHHK8"] = "0";
                    dwReturn["GPHHK9"] = "0";
                    dwReturn["GPHHK10"] = "0";
                    dwReturn["GPHHKG"] = "0";
                    dwReturn["GPAHK1"] = "0";
                    dwReturn["GPAHK2"] = "0";
                    dwReturn["GPAHK3"] = "0";
                    dwReturn["GPAHK4"] = "0";
                    dwReturn["GPAHK5"] = "0";
                    dwReturn["GPAHK6"] = "0";
                    dwReturn["GPAHK7"] = "0";
                    dwReturn["GPAHK8"] = "0";
                    dwReturn["GPAHK9"] = "0";
                    dwReturn["GPAHK10"] = "0";
                    dwReturn["GPAHKG"] = "0";
                    dwReturn["GPABPZAB"] = "0";
                    dwReturn["GPABDATAB"] = "0";
                    dwReturn["GPPTYP"] = " ";
                    dwReturn["GPPDAT"] = "0";
                    dwReturn["GPPUSER"] = "        ";
                    dwReturn["GPQORDER"] = "0";
                    dwReturn["GPPPOINTL05S"] = "0";
                    dwReturn["GPPPOINTL10S"] = "0";
                    dwReturn["GPPPOINTD05S"] = "0";
                    dwReturn["GPPPOINTD10S"] = "0";
                    dwReturn["GPNEPS10S"] = "0";
                    dwReturn["GPNEPS20S"] = "0";
                    dwReturn["GPSLUBSS"] = "0";
                    dwReturn["GPVM004S"] = "0";
                    dwReturn["GPVM410S"] = "0";
                    dwReturn["GPVM100S"] = "0";
                    dwReturn["GPBURNSS"] = "0";
                    dwReturn["GPFORFIBS"] = "0";
                    dwReturn["GPDRKFIBLS"] = "0";
                    dwReturn["GPDRKFIBMS"] = "0";
                    dwReturn["GPDRKFIBDS"] = "0";
                    dwReturn["GPDFSHADE"] = "   ";
                    dwReturn["GPMICRONLAV"] = "0";
                    dwReturn["GPMICRONLSV"] = "0";
                    dwReturn["GPMICRONLCV"] = "0";
                    dwReturn["GPMICRONL30"] = "0";
                    dwReturn["GPMICRONAAV"] = "0";
                    dwReturn["GPMICRONASV"] = "0";
                    dwReturn["GPMICRONACV"] = "0";
                    dwReturn["GPMICRONA30"] = "0";
                    dwReturn["GPFIBL1AV"] = "0";
                    dwReturn["GPFIBL1SV"] = "0";
                    dwReturn["GPFIBL1CV"] = "0";
                    dwReturn["GPFIBL130"] = "0";
                    dwReturn["GPFIBL140"] = "0";
                    dwReturn["GPFIBL11P"] = "0";
                    dwReturn["GPFIBL12P"] = "0";
                    dwReturn["GPFIBL1UHML"] = "0";
                    dwReturn["GPFIBL2AV"] = "0";
                    dwReturn["GPFIBL2SV"] = "0";
                    dwReturn["GPFIBL2CV"] = "0";
                    dwReturn["GPFIBL230"] = "0";
                    dwReturn["GPFIBL240"] = "0";
                    dwReturn["GPFIBL21P"] = "0";
                    dwReturn["GPFIBL22P"] = "0";
                    dwReturn["GPFIBL2UHML"] = "0";
                    dwReturn["GPUR"] = "0";
                    dwReturn["GPUI"] = "0";
                    dwReturn["GPSLIVERWT"] = "0";
                    dwReturn["GPGREASE"] = "0";
                    dwReturn["GPSALT"] = "0";
                    dwReturn["GPPH"] = "0";
                    dwReturn["GPWETTAB"] = "0";
                    dwReturn["GPWHITEN"] = "0";
                    dwReturn["GPQGRAD"] = "   ";
                    dwReturn["GPBWORK"] = "0";
                    dwReturn["GPBFORCE"] = "0";
                    dwReturn["GPBFORCECV"] = "0";
                    dwReturn["GPELONG"] = "0";
                    dwReturn["GPELONGCV"] = "0";
                    dwReturn["GPTENACITY"] = "0";
                    dwReturn["GPPRESSLEY"] = "0";
                    dwReturn["GPAVIV"] = "0";
                    dwReturn["GPSCIG"] = "0";
                    dwReturn["GPSCHLIGR"] = " ";
                    dwReturn["GPSCHLINR"] = "000";
                    dwReturn["GPWAX"] = "0";
                    dwReturn["GPWAXTD"] = "00000000";
                    dwReturn["GPWAXVD"] = "00000000";
                    dwReturn["GPUCV"] = "0";
                    dwReturn["GPTHINP40"] = "0";
                    dwReturn["GPTHINP50"] = "0";
                    dwReturn["GPTHICKP35"] = "0";
                    dwReturn["GPTHICKP50"] = "0";
                    dwReturn["GPNEPS140"] = "0";
                    dwReturn["GPNEPS200"] = "0";
                    dwReturn["GPHAIR"] = "0";
                    dwReturn["GPUINDEX"] = "0";
                    dwReturn["GPYTPM"] = "0";
                    dwReturn["GPENDBKG"] = "0";
                    dwReturn["GPENDBHKM"] = "0";
                    dwReturn["GPWEFTONLY"] = " ";
                    dwReturn["GPLIART1"] = "     ";
                    dwReturn["GPDELTAE1"] = "0";
                    dwReturn["GPDELTAL1"] = "0";
                    dwReturn["GPDELTAA1"] = "0";
                    dwReturn["GPDELTAB1"] = "0";
                    dwReturn["GPDELTAC1"] = "0";
                    dwReturn["GPDELTAH1"] = "0";
                    dwReturn["GPLIART2"] = "     ";
                    dwReturn["GPDELTAE2"] = "0";
                    dwReturn["GPDELTAL2"] = "0";
                    dwReturn["GPDELTAA2"] = "0";
                    dwReturn["GPDELTAB2"] = "0";
                    dwReturn["GPDELTAC2"] = "0";
                    dwReturn["GPDELTAH2"] = "0";
                    dwReturn["GPLIART3"] = "     ";
                    dwReturn["GPDELTAE3"] = "0";
                    dwReturn["GPDELTAL3"] = "0";
                    dwReturn["GPDELTAA3"] = "0";
                    dwReturn["GPDELTAB3"] = "0";
                    dwReturn["GPDELTAC3"] = "0";
                    dwReturn["GPDELTAH3"] = "0";
                    dwReturn["GPCOMMENT"] = "                                                                      ";
                    dwReturn["GPTREATMT1"] = "   ";
                    dwReturn["GPTREATMT2"] = "   ";
                    dwReturn["GPFERTKZ"] = "Z";
                    dwReturn["GPDEZI"] = " ";
                    dwReturn["GPNEPS10DS"] = "0000";
                    dwReturn["GPNEPS20DS"] = "0000";
                    dwReturn["GPSLUBSDS"] = "0000";
                    dwReturn["GPTEILLFG"] = " ";
                    dwReturn["GPEINLB"] = "YM";
                    dwReturn["GPSPEDF"] = " ";
                    dwReturn["GPSPEDV"] = " ";
                    dwReturn["GPSPEDZ"] = " ";
                    dwReturn["GPURRENR"] = "          ";
                    dwReturn["GPARTGS"] = "  ";
                    dwReturn["GPVERF"] = "     ";
                    dwReturn["GPAVVME"] = " ";
                    dwReturn["GPBEWPFL"] = " ";
                    dwReturn["GPBEFREI"] = "    ";
                    dwReturn["GPURLAND"] = "CN ";
                    dwReturn["GPIURLAND"] = "00";
                    dwReturn["GPHALAND"] = "   ";
                    dwReturn["GPVSLAND"] = "   ";
                    dwReturn["GPVZWEIG"] = " ";
                    dwReturn["GPTPMLKZ"] = "   ";
                    dwReturn["GPCONTV"] = " ";
                    dwReturn["GPCONTNR"] = "                    ";
                    dwReturn["GPZOLLST"] = "      ";
                    dwReturn["GPZOLLSTAF"] = "      ";
                    dwReturn["GPPRLAND"] = "CN ";
                    dwReturn["GPURLANDWO"] = "   ";
                    dwReturn["GPBUSIMODE"] = "   ";
                    dwReturn["GPKUNDNRA"] = "        ";
                    dwReturn["GPKUNDADRE"] = "        ";
                    dwReturn["GPKUNDADRB"] = "        ";
                    dwReturn["GPKUNDNRR"] = "        ";
                    dwReturn["GPDRVERT"] = "                    ";
                    dwReturn["GPCBOOKNO"] = "               ";
                    dwReturn["GPCITEMNO"] = "0";
                    dwReturn["GPCVORDOC"] = "          ";
                    dwReturn["GPCGENEHM"] = "                      ";
                    dwReturn["GPDOCT1"] = " ";
                    dwReturn["GPDOCNB1"] = "00";
                    dwReturn["GPDOCNO1"] = "               ";
                    dwReturn["GPDOCT2"] = " ";
                    dwReturn["GPDOCNB2"] = "00";
                    dwReturn["GPDOCNO2"] = "               ";
                    dwReturn["GPDOCT3"] = " ";
                    dwReturn["GPDOCNB3"] = "00";
                    dwReturn["GPDOCNO3"] = "               ";
                    dwReturn["GPDOCT4"] = " ";
                    dwReturn["GPDOCNB4"] = "00";
                    dwReturn["GPDOCNO4"] = "               ";
                    dwReturn["GPIVZWEIG"] = " ";
                    dwReturn["GPAHKSRC"] = " ";
                    dwReturn["GPAABSRC"] = " ";
                    dwReturn["GPIPREIS"] = "0";
                    dwReturn["GPGEPRUEFT"] = " ";
                    dwReturn["GPYBTSPDLH"] = "0";
                    dwReturn["GPCUTSHKM"] = "0";
                    dwReturn["GPSPEED"] = "0";
                    dwReturn["GPFILLER"] = "                                         ";
                    dwReturn["GPAENDZL"] = "2";
                    dwReturn["GPAENDBEN"] = "XKV     ";
                    dwReturn["GPAENDDAT"] = "20141017";
                    dwReturn["GPNEUBEN"] = "XKV     ";
                    dwReturn["GPNEUDAT"] = "20141016";
                    #endregion
                    break;
            }
            INTEXDBC.MapData(true, ref dwReturn, dwInput);
        }

        public DataSet QueryGPDAT(DataRow dwData, int option = 1)
        {
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            string qm = "";
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM GPDAT WHERE  ROWNUM<2 ";
                    break;
                case 1:
                    or1.CommandText = "SELECT * FROM GPDAT WHERE GPMANDANT=:GPMANDANT: AND GPPARTIE=:GPPARTIE:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 2:
                    or1.CommandText = "SELECT * FROM GPDAT WHERE GPMANDANT=:GPMANDANT: AND GPPARTIE=:GPPARTIE:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 3:
                    qm = VQPMERKM.Instance.TTLQT();
                    or1.CommandText = "SELECT DISTINCT " + qm + "NVL(QOKORDER,'000000000') AS QOKORDER,0 as YCOUNT,QOKNEUD,GPGART,GPGVAR,GPGFARBE,GPPARTIE,GPPARTIEKZ,GPSPPART,GPFBPART,GPZWPART,GPAENDBEN,GPAENDDAT,GPNEUBEN,GPNEUDAT, GPBEM1, GPBEM2 "
                    + " FROM GPDAT P LEFT JOIN QORDER Q ON QOKMANDANT=GPMANDANT AND QOKWEPARTIE=GPPARTIE"
                    + " LEFT JOIN QOSTEP ON  QOKMANDANT=QOEMANDANT AND QOKORDER=QOEORDER "
                    + " WHERE GPMANDANT=:GPMANDANT:  AND (GPGEPRUEFT=:GPGEPRUEFT: OR GPGEPRUEFT=' ') AND SUBSTR(GPGART,1,1)=:GPGART:"
                     + " AND GPGFARBE LIKE '" + dwData["GPGFARBE"].ToString().Trim() + "%'"
                    //   + "%' AND GPPARTIE LIKE '%" + dwData["GPPARTIE"].ToString().Trim()
                    + " AND (GPSPPART LIKE '" + dwData["GPSPPART"].ToString().Trim() + "%'"
                    + " OR GPFBPART LIKE '" + dwData["GPSPPART"].ToString().Trim() + "%')"
                    // + "%' AND GPZWPART LIKE '" + dwData["GPZWPART"].ToString().Trim() + "%'"                  
                    + " ORDER BY GPSPPART,QOKORDER,GPFBPART,GPZWPART ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 4:
                    or1.CommandText = "SELECT DISTINCT GP.* FROM ZUTEI RIGHT JOIN GPDAT GP ON ZUMANDANT=GPMANDANT AND ZUPARTIE=GPPARTIE"
                    + " WHERE  ZUMANDANT=:ZUMANDANT: AND ZUAUFKRS=:ZUAUFKRS: AND ZUAUFLFD=:ZUAUFLFD:"; ;
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 5:
                    or1.CommandText = "SELECT * FROM GPDAT WHERE GPMANDANT=:GPMANDANT: AND GPPARTIE=:GPPARTIE: AND GPPARTIEKZ=:GPPARTIEKZ: ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 11:
                    or1.CommandText = "SELECT DISTINCT " + dwData["GPFILLER"].ToString() + "NVL(QOKORDER,'000000000') AS QOKORDER,0 as YCOUNT,GPGART,GPGVAR,GPGFARBE,GPPARTIE,GPPARTIEKZ,GPSPPART,GPFBPART,GPZWPART,GPAENDBEN,GPAENDDAT,GPNEUBEN,GPNEUDAT, GPBEM1, GPBEM2 FROM GPDAT P LEFT JOIN QORDER Q ON QOKMANDANT=GPMANDANT AND QOKWEPARTIE=GPPARTIE LEFT JOIN QOSTEP ON  QOKMANDANT=QOEMANDANT AND QOKORDER=QOEORDER "
                    + " WHERE GPMANDANT=:GPMANDANT: AND GPPARTIE=:GPPARTIE: AND QOKORDER =:GPBESTTYP:"
                    + " ORDER BY GPSPPART,QOKORDER,GPFBPART,GPZWPART ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 12:
                    qm = VQPMERKM.Instance.TTLQT();
                    or1.CommandText = "SELECT DISTINCT " + qm + "NVL(QOKORDER,'000000000') AS QOKORDER,0 as YCOUNT,QOKNEUD,GPGART,GPGVAR,GPGFARBE,GPPARTIE,GPPARTIEKZ,GPSPPART,GPFBPART,GPZWPART,GPAENDBEN,GPAENDDAT,GPNEUBEN,GPNEUDAT, GPBEM1, GPBEM2 "
                    + " FROM GPDAT P LEFT JOIN QORDER Q ON QOKMANDANT=GPMANDANT AND QOKWEPARTIE=GPPARTIE"
                    + " LEFT JOIN QOSTEP ON  QOKMANDANT=QOEMANDANT AND QOKORDER=QOEORDER "
                    + " WHERE GPMANDANT=:GPMANDANT:  AND (GPGEPRUEFT=:GPGEPRUEFT: OR GPGEPRUEFT=' ') AND SUBSTR(GPGART,1,1)=:GPGART:"
                    + " AND QOKNEUD>=:GPNEUBEN: AND QOKNEUD<=:GPAENDBEN:"
                    + " AND GPGFARBE LIKE '" + dwData["GPGFARBE"].ToString().Trim() + "%'"
                    //   + "%' AND GPPARTIE LIKE '%" + dwData["GPPARTIE"].ToString().Trim()
                    + " AND (GPSPPART LIKE '" + dwData["GPSPPART"].ToString().Trim() + "%'"
                    + " OR GPFBPART LIKE '" + dwData["GPSPPART"].ToString().Trim() + "%')"
                    // + "%' AND GPZWPART LIKE '" + dwData["GPZWPART"].ToString().Trim() + "%'"                  
                    + " ORDER BY GPSPPART,QOKORDER,GPFBPART,GPZWPART ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case -1:
                    or1.CommandText = "SELECT DISTINCT GPPARTIE AS KEY,GPPARTIE  FROM GPDAT WHERE GPMANDANT=:GPMANDANT: AND GPGART=:GPGART: AND GPGVAR=:GPGVAR: ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case -2:
                    or1.CommandText = "SELECT DISTINCT GPGART,GPGVAR, GPSPPART AS KEY,GPSPPART  FROM GPDAT WHERE GPMANDANT=:GPMANDANT: AND GPGART=:GPGART: AND GPGVAR=:GPGVAR: ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case -3:
                    or1.CommandText = "SELECT DISTINCT GPGART,GPGVAR, GPFBPART AS KEY,GPFBPART  FROM GPDAT WHERE GPMANDANT=:GPMANDANT: AND GPGART=:GPGART: AND GPGVAR=:GPGVAR: ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case -4:
                    or1.CommandText = "SELECT DISTINCT GPGART,GPGVAR, GPZWPART AS KEY,GPZWPART  FROM GPDAT WHERE GPMANDANT=:GPMANDANT: AND GPGART=:GPGART: AND GPGVAR=:GPGVAR: ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case -5:
                    or1.CommandText = "SELECT MAX(GPPARTIE) AS GPPARTIE  FROM GPDAT WHERE GPMANDANT=:GPMANDANT: ";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                Result.Tables[0].TableName = "GPDAT";
            }
            return Result;
        }
        public void InsertGPDAT(DataRow dwData, string ITXDBVERSION = "50.24")
        {

            dwData["GPNEUBEN"] = app.User;
            dwData["GPNEUDAT"] = date;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                case "TST":
                case "SXN":
                case "UBT":
                default:
                    or1.CommandText = "INSERT INTO GPDAT ( GPMANDANT,GPPARTIE,GPPARTIEKZ,GPGART,GPGVAR,GPGFARBE,GPBESTTYP,GPBESTKRS,GPBESTLFD,GPBESTPOS,GPPOSA,GPLIEFNR,GPKUNDNR,GPEINDAT,GPSPULBST,GPSPSTA,GPSPGRD,GPFDRES,GPKF,GPZENSUR1,GPZENDAT1,GPZENSUR2,GPZENDAT2,GPZENSUR3,GPZENDAT3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PWHITEN,GPQGRAD,GPBWORK,GPBFORCE,GPBFORCECV,GPELONG,GPELONGCV,GPTENACITY,GPPRESSLEY,GPAVIV,GPSCIG,GPSCHLIGR,GPSCHLINR,GPWAX,GPWAXTD,GPWAXVD,GPUCV,GPTHINP40,GPTHINP50,GPTHICKP35,GPTHICKP50,GPNEPS140,GPNEPS200,GPHAIR,GPUINDEX,GPYTPM,GPENDBKG,GPENDBHKM,GPWEFTONLY,GPLIART1,GPDELTAE1,GPDELTAL1,GPDELTAA1,GPDELTAB1,GPDELTAC1,GPDELTAH1,GPLIART2,GPDELTAE2,GPDELTAL2,GPDELTAA2,GPDELTAB2,GPDELTAC2,GPDELTAH2,GPLIART3,GPDELTAE3,GPDELTAL3,GPDELTAA3,GPDELTAB3,GPDELTAC3,GPDELTAH3,GPCOMMENT,GPTREATMT1,GPTREATMT2,GPFERTKZ,GPDEZI,GPNEPS10DS,GPNEPS20DS,GPSLUBSDS,GPTEILLFG,GPEINLB,GPSPEDF,GPSPEDV,GPSPEDZ,GPURRENR,GPARTGS,GPVERF,GPAVVME,GPBEWPFL,GPBEFREI,GPURLAND,GPIURLAND,GPHALAND,GPVSLAND,GPVZWEIG,GPTPMLKZ,GPCONTV,GPCONTNR,GPZOLLST,GPZOLLSTAF,GPPRLAND,GPURLANDWO,GPBUSIMODE,GPKUNDNRA,GPKUNDADRE,GPKUNDADRB,GPKUNDNRR,GPDRVERT,GPCBOOKNO,GPCITEMNO,GPCVORDOC,GPCGENEHM,GPDOCT1,GPDOCNB1,GPDOCNO1,GPDOCT2,GPDOCNB2,GPDOCNO2,GPDOCT3,GPDOCNB3,GPDOCNO3,GPDOCT4,GPDOCNB4,GPDOCNO4,GPIVZWEIG,GPAHKSRC,GPAABSRC,GPIPREIS,GPGEPRUEFT,GPYBTSPDLH,GPCUTSHKM,GPSPEED,GPFILLER,GPAENDZL,GPAENDBEN,GPAENDDAT,GPNEUBEN,GPNEUDAT)"
                    + " VALUES (:GPMANDANT:,:GPPARTI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POINTD05S:,:GPPPOINTD10S:,:GPNEPS10S:,:GPNEPS20S:,:GPSLUBSS:,:GPVM004S:,:GPVM410S:,:GPVM100S:,:GPBURNSS:,:GPFORFIBS:,:GPDRKFIBLS:,:GPDRKFIBMS:,:GPDRKFIBDS:,:GPDFSHADE:,:GPMICRONLAV:,:GPMICRONLSV:,:GPMICRONLCV:,:GPMICRONL30:,:GPMICRONAAV:,:GPMICRONASV:,:GPMICRONACV:,:GPMICRONA30:,:GPFIBL1AV:,:GPFIBL1SV:,:GPFIBL1CV:,:GPFIBL130:,:GPFIBL140:,:GPFIBL11P:,:GPFIBL12P:,:GPFIBL1UHML:,:GPFIBL2AV:,:GPFIBL2SV:,:GPFIBL2CV:,:GPFIBL230:,:GPFIBL240:,:GPFIBL21P:,:GPFIBL22P:,:GPFIBL2UHML:,:GPUR:,:GPUI:,:GPSLIVERWT:,:GPGREASE:,:GPSALT:,:GPPH:,:GPWETTAB:,:GPWHITEN:,:GPQGRAD:,:GPBWORK:,:GPBFORCE:,:GPBFORCECV:,:GPELONG:,:GPELONGCV:,:GPTENACITY:,:GPPRESSLEY:,:GPAVIV:,:GPSCIG:,:GPSCHLIGR:,:GPSCHLINR:,:GPWAX:,:GPWAXTD:,:GPWAXVD:,:GPUCV:,:GPTHINP40:,:GPTHINP50:,:GPTHICKP35:,:GPTHICKP50:,:GPNEPS140:,:GPNEPS200:,:GPHAIR:,:GPUINDEX:,:GPYTPM:,:GPENDBKG:,:GPENDBHKM:,:GPWEFTONLY:,:GPLIART1:,:GPDELTAE1:,:GPDELTAL1:,:GPDELTAA1:,:GPDELTAB1:,:GPDELTAC1:,:GPDELTAH1:,:GPLIART2:,:GPDELTAE2:,:GPDELTAL2:,:GPDELTAA2:,:GPDELTAB2:,:GPDELTAC2:,:GPDELTAH2:,:GPLIART3:,:GPDELTAE3:,:GPDELTAL3:,:GPDELTAA3:,:GPDELTAB3:,:GPDELTAC3:,:GPDELTAH3:,:GPCOMMENT:,:GPTREATMT1:,:GPTREATMT2:,:GPFERTKZ:,:GPDEZI:,:GPNEPS10DS:,:GPNEPS20DS:,:GPSLUBSDS:,:GPTEILLFG:,:GPEINLB:,:GPSPEDF:,:GPSPEDV:,:GPSPEDZ:,:GPURRENR:,:GPARTGS:,:GPVERF:,:GPAVVME:,:GPBEWPFL:,:GPBEFREI:,:GPURLAND:,:GPIURLAND:,:GPHALAND:,:GPVSLAND:,:GPVZWEIG:,:GPTPMLKZ:,:GPCONTV:,:GPCONTNR:,:GPZOLLST:,:GPZOLLSTAF:,:GPPRLAND:,:GPURLANDWO:,:GPBUSIMODE:,:GPKUNDNRA:,:GPKUNDADRE:,:GPKUNDADRB:,:GPKUNDNRR:,:GPDRVERT:,:GPCBOOKNO:,:GPCITEMNO:,:GPCVORDOC:,:GPCGENEHM:,:GPDOCT1:,:GPDOCNB1:,:GPDOCNO1:,:GPDOCT2:,:GPDOCNB2:,:GPDOCNO2:,:GPDOCT3:,:GPDOCNB3:,:GPDOCNO3:,:GPDOCT4:,:GPDOCNB4:,:GPDOCNO4:,:GPIVZWEIG:,:GPAHKSRC:,:GPAABSRC:,:GPIPREIS:,:GPGEPRUEFT:,:GPYBTSPDLH:,:GPCUTSHKM:,:GPSPEED:,:GPFILLER:,:GPAENDZL:,:GPAENDBEN:,:GPAENDDAT:,:GPNEUBEN:,:GPNEUDAT:)";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
            } 
            Connect2Proxy(or1);
        }
        public void DGP01(DataRow dwData)
        {
            
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE FROM  GPDAT "
                +" WHERE GPMANDANT=:GPMANDANT: AND GPPARTIE = :GPPARTIE:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UpdateGPDAT(DataRow dwData, int option = 1)
        {
            dwData["GPAENDBEN"] = app.User;
            dwData["GPAENDDAT"] = date;
            or1 = OracleDB.CreateCommand();
            if (option == 0)
            {
                switch (app.company)
                {
                    case "YGR":
                    case "TST":
                    case "SXN":
                    case "UBT":
                    default:
                        UGP00(dwData);
                        break;
                }
            }
            switch (option)
            {

                case 1:
                    UGP01(dwData);
                    break;
                case 2:
                    UGP02(dwData);
                    break;

            } 
        }
        public void UGP00(DataRow dwData)
        {
            dwData["GPAENDBEN"] = app.User;
            dwData["GPAENDDAT"] = date;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE GPDAT SET GPMANDANT=:GPMANDANT:,GPPARTIE=:GPPARTIE:,GPPARTIEKZ=:GPPARTIEKZ:,GPGART=:GPGART:,GPGVAR=:GPGVAR:,GPGFARBE=:GPGFARBE:,GPBESTTYP=:GPBESTTYP:,GPBESTKRS=:GPBESTKRS:,GPBESTLFD=:GPBESTLFD:,GPBESTPOS=:GPBESTPOS:,GPPOSA=:GPPOSA:,GPLIEFNR=:GPLIEFNR:,GPKUNDNR=:GPKUNDNR:,GPEINDAT=:GPEINDAT:,GPSPULBST=:GPSPULBST:,GPSPSTA=:GPSPSTA:,GPSPGRD=:GPSPGRD:,GPFDRES=:GPFDRES:,GPKF=:GPKF:,GPZENSUR1=:GPZENSUR1:,GPZENDAT1=:GPZENDAT1:,GPZENSUR2=:GPZENSUR2:,GPZENDAT2=:GPZENDAT2:,GPZENSUR3=:GPZENSUR3:,GPZENDAT3=:GPZENDAT3:,GPGEM=:GPGEM:,GPLAENGE=:GPLAENGE:,GPWICKL=:GPWICKL:,GPAUFMSL=:GPAUFMSL:,GPLIEFSCH=:GPLIEFSCH:,GPREDAT=:GPREDAT:,GPBUCHDAT=:GPBUCHDAT:,GPRENR=:GPRENR:,GPREWERT=:GPREWERT:,GPSPPART=:GPSPPART:,GPFBPART=:GPFBPART:,GPZWPART=:GPZWPART:,GPIFEUCHTE=:GPIFEUCHTE:,GPEINBRUT=:GPEINBRUT:,GPEINNET=:GPEINNET:,GPEINHAN=:GPEINHAN:,GPEINKART=:GPEINKART:,GPEINSPUL=:GPEINSPUL:,GPVER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QORDER:,GPPPOINTL05S=:GPPPOINTL05S:,GPPPOINTL10S=:GPPPOINTL10S:,GPPPOINTD05S=:GPPPOINTD05S:,GPPPOINTD10S=:GPPPOINTD10S:,GPNEPS10S=:GPNEPS10S:,GPNEPS20S=:GPNEPS20S:,GPSLUBSS=:GPSLUBSS:,GPVM004S=:GPVM004S:,GPVM410S=:GPVM410S:,GPVM100S=:GPVM100S:,GPBURNSS=:GPBURNSS:,GPFORFIBS=:GPFORFIBS:,GPDRKFIBLS=:GPDRKFIBLS:,GPDRKFIBMS=:GPDRKFIBMS:,GPDRKFIBDS=:GPDRKFIBDS:,GPDFSHADE=:GPDFSHADE:,GPMICRONLAV=:GPMICRONLAV:,GPMICRONLSV=:GPMICRONLSV:,GPMICRONLCV=:GPMICRONLCV:,GPMICRONL30=:GPMICRONL30:,GPMICRONAAV=:GPMICRONAAV:,GPMICRONASV=:GPMICRONASV:,GPMICRONACV=:GPMICRONACV:,GPMICRONA30=:GPMICRONA30:,GPFIBL1AV=:GPFIBL1AV:,GPFIBL1SV=:GPFIBL1SV:,GPFIBL1CV=:GPFIBL1CV:,GPFIBL130=:GPFIBL130:,GPFIBL140=:GPFIBL140:,GPFIBL11P=:GPFIBL11P:,GPFIBL12P=:GPFIBL12P:,GPFIBL1UHML=:GPFIBL1UHML:,GPFIBL2AV=:GPFIBL2AV:,GPFIBL2SV=:GPFIBL2SV:,GPFIBL2CV=:GPFIBL2CV:,GPFIBL230=:GPFIBL230:,GPFIBL240=:GPFIBL240:,GPFIBL21P=:GPFIBL21P:,GPFIBL22P=:GPFIBL22P:,GPFIBL2UHML=:GPFIBL2UHML:,GPUR=:GPUR:,GPUI=:GPUI:,GPSLIVERWT=:GPSLIVERWT:,GPGREASE=:GPGREASE:,GPSALT=:GPSALT:,GPPH=:GPPH:,GPWETTAB=:GPWETTAB:,GPWHITEN=:GPWHITEN:,GPQGRAD=:GPQGRAD:,GPBWORK=:GPBWORK:,GPBFORCE=:GPBFORCE:,GPBFORCECV=:GPBFORCECV:,GPELONG=:GPELONG:,GPELONGCV=:GPELONGCV:,GPTENACITY=:GPTENACITY:,GPPRESSLEY=:GPPRESSLEY:,GPAVIV=:GPAVIV:,GPSCIG=:GPSCIG:,GPSCHLIGR=:GPSCHLIGR:,GPSCHLINR=:GPSCHLINR:,GPWAX=:GPWAX:,GPWAXTD=:GPWAXTD:,GPWAXVD=:GPWAXVD:,GPUCV=:GPUCV:,GPTHINP40=:GPTHINP40:,GPTHINP50=:GPTHINP50:,GPTHICKP35=:GPTHICKP35:,GPTHICKP50=:GPTHICKP50:,GPNEPS140=:GPNEPS140:,GPNEPS200=:GPNEPS200:,GPHAIR=:GPHAIR:,GPUINDEX=:GPUINDEX:,GPYTPM=:GPYTPM:,GPENDBKG=:GPENDBKG:,GPENDBHKM=:GPENDBHKM:,GPWEFTONLY=:GPWEFTONLY:,GPLIART1=:GPLIART1:,GPDELTAE1=:GPDELTAE1:,GPDELTAL1=:GPDELTAL1:,GPDELTAA1=:GPDELTAA1:,GPDELTAB1=:GPDELTAB1:,GPDELTAC1=:GPDELTAC1:,GPDELTAH1=:GPDELTAH1:,GPLIART2=:GPLIART2:,GPDELTAE2=:GPDELTAE2:,GPDELTAL2=:GPDELTAL2:,GPDELTAA2=:GPDELTAA2:,GPDELTAB2=:GPDELTAB2:,GPDELTAC2=:GPDELTAC2:,GPDELTAH2=:GPDELTAH2:,GPLIART3=:GPLIART3:,GPDELTAE3=:GPDELTAE3:,GPDELTAL3=:GPDELTAL3:,GPDELTAA3=:GPDELTAA3:,GPDELTAB3=:GPDELTAB3:,GPDELTAC3=:GPDELTAC3:,GPDELTAH3=:GPDELTAH3:,GPCOMMENT=:GPCOMMENT:,GPTREATMT1=:GPTREATMT1:,GPTREATMT2=:GPTREATMT2:,GPFERTKZ=:GPFERTKZ:,GPDEZI=:GPDEZI:,GPNEPS10DS=:GPNEPS10DS:,GPNEPS20DS=:GPNEPS20DS:,GPSLUBSDS=:GPSLUBSDS:,GPTEILLFG=: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LER:,GPAENDZL=:GPAENDZL:,GPAENDBEN=:GPAENDBEN:,GPAENDDAT=:GPAENDDAT:,GPNEUBEN=:GPNEUBEN:,GPNEUDAT=:GPNEUDAT:"
                + " WHERE GPMANDANT=:GPMANDANT: AND GPPARTIE = :GPPARTIE: AND GPPARTIEKZ = :GPPARTIEKZ: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UGP01(DataRow dwData)
        {
         
            or1 = OracleDB.CreateCommand(); 
            or1.CommandText = "UPDATE GPDAT SET  GPFBPART=:GPFBPART: WHERE GPMANDANT=:GPMANDANT: AND GPPARTIE = :GPPARTIE: AND GPPARTIEKZ = :GPPARTIEKZ: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
            Connect2Proxy(or1);
        }

        public void UGP02(DataRow dwData)
        { 
            or1 = OracleDB.CreateCommand(); 
            or1.CommandText = "UPDATE GPDAT SET  GPGEPRUEFT=:GPGEPRUEFT: WHERE GPMANDANT=:GPMANDANT: AND GPPARTIE = :GPPARTIE:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
            Connect2Proxy(or1);
        }
        public void UGP03(DataRow dwData)
        {
            
            
            
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE GPDAT SET (GPEINNET,GPEINBRUT,GPEINHAN,GPEINKART)=(SELECT NVL(SUM(GLBSTNET),0) AS GLBSTNET, nvl(SUM(GLBSTKG),0),nvl(SUM(GLBSTKG),0),NVL(SUM(GLBSTKA),0) FROM GLLG"
                 + " WHERE  GPMANDANT=GLMANDANT AND GPPARTIE=GLPARTIE AND GPPARTIEKZ=GLPARTIEKZ )"
                 + " WHERE GPMANDANT=:GPMANDANT: AND GPPARTIE=:GPPARTIE: AND GPPARTIEKZ=:GPPARTIEKZ:   ";
            
            or1.CommandText = "UPDATE GPDAT SET  GPFBPART=:GPFBPART: WHERE GPMANDANT=:GPMANDANT: AND GPPARTIE = :GPPARTIE: AND GPPARTIEKZ = :GPPARTIEKZ: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
    }
}
